package dao.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "selection", catalog = "makeiteasy")
public class Selection implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	private Integer selectionId;
	private String selectionDirections;
	private String selectionPassge;
	private String selections;
	private String selectionKeys;
	private Set<Test> tests = new HashSet<Test>(0);

	// Constructors

	/** default constructor */
	public Selection() {
	}

	/** full constructor */
	public Selection(String selectionDirections, String selectionPassge,
			String selections, String selectionKeys, Set<Test> tests) {
		this.selectionDirections = selectionDirections;
		this.selectionPassge = selectionPassge;
		this.selections = selections;
		this.selectionKeys = selectionKeys;
		this.tests = tests;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "selectionId", unique = true, nullable = false)
	public Integer getSelectionId() {
		return this.selectionId;
	}

	public void setSelectionId(Integer selectionId) {
		this.selectionId = selectionId;
	}

	@Column(name = "selectionDirections", length = 256)
	public String getSelectionDirections() {
		return this.selectionDirections;
	}

	public void setSelectionDirections(String selectionDirections) {
		this.selectionDirections = selectionDirections;
	}

	@Column(name = "selectionPassge", length = 256)
	public String getSelectionPassge() {
		return this.selectionPassge;
	}

	public void setSelectionPassge(String selectionPassge) {
		this.selectionPassge = selectionPassge;
	}

	@Column(name = "selections", length = 2048)
	public String getSelections() {
		return this.selections;
	}

	public void setSelections(String selections) {
		this.selections = selections;
	}

	@Column(name = "selectionKeys", length = 256)
	public String getSelectionKeys() {
		return this.selectionKeys;
	}

	public void setSelectionKeys(String selectionKeys) {
		this.selectionKeys = selectionKeys;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "selection")
	public Set<Test> getTests() {
		return this.tests;
	}

	public void setTests(Set<Test> tests) {
		this.tests = tests;
	}

}